clear

***********************************************
*Read-in panel data
use "./data/fomc_panel_b", clear

* Drop US
keep if ccode != 49 

foreach k in yield2y yield10y {

	*Standardize dependent variables country-by-country*
	bysort ccode: egen `k'_2day_sd = sd(`k'_2day)
	
	replace `k'_2day = `k'_2day / `k'_2day_sd

} 

****ADVANCED****
preserve

keep if advanced==1 

quietly: levelsof ccode , local(levels) 

***2day, std***

*********************** Regressions *********************************************
foreach k in yield2y yield10y {

	foreach i in `levels' { 
	
		***POOLED SAMPLE***
		* Full Sample
		quietly: reghdfe `k'_2day mps_2day mpu_2day if ccode!=`i', noabsorb cluster(ccode time)
		estimates store `k'_`i'_full
		
		
	}

	
	coefplot (`k'_2_full) ///
			 (`k'_3_full) ///
			 (`k'_4_full) ///
			 (`k'_6_full) ///
			 (`k'_9_full) ///
			 (`k'_10_full) ///
			 (`k'_11_full) ///
			 (`k'_12_full) ///
			 (`k'_13_full) ///
			 (`k'_14_full) ///
			 (`k'_16_full) ///
			 (`k'_18_full) ///
			 (`k'_21_full) ///
			 (`k'_22_full) ///
			 (`k'_23_full) ///
			 (`k'_24_full) ///
			 (`k'_25_full) ///
			 (`k'_29_full) ///
			 (`k'_30_full) ///
			 (`k'_31_full) ///
			 (`k'_36_full) ///
			 (`k'_38_full) ///
			 (`k'_39_full) ///
			 (`k'_40_full) ///
			 (`k'_42_full) ///
			 (`k'_43_full) ///
			 (`k'_44_full) ///
			 (`k'_48_full) ///
		,keep(mpu_2day) mcolor(white) mlcolor(black) coeflabels(mpu_2day = " ") ///
		 ciopts(recast(rcap) lcolor(black)) levels(90) legend(off) msymbol(circle)
		 
		graph export "tables\figureA7_`k'_advanced.pdf", replace	
		
	
	clear matrix 

}

restore 

****EME****
preserve

keep if advanced==0

quietly: levelsof ccode , local(levels) 

*********************** Regressions *********************************************
foreach k in yield2y yield10y {

	foreach i in `levels' { 
	
		***POOLED SAMPLE***
		* Full Sample
		quietly: reghdfe `k'_2day mps_2day mpu_2day if ccode!=`i', noabsorb cluster(ccode time)
		estimates store `k'_`i'_full
		
		
	}
			
	coefplot (`k'_1_full) ///
			 (`k'_7_full) ///
			 (`k'_8_full) ///
			 (`k'_17_full) ///
			 (`k'_19_full) ///
			 (`k'_20_full) ///
			 (`k'_26_full) ///
			 (`k'_27_full) ///
			 (`k'_32_full) ///
			 (`k'_33_full) ///
			 (`k'_34_full) ///
			 (`k'_35_full) ///
			 (`k'_37_full) ///
			 (`k'_41_full) ///
			 (`k'_46_full) ///
			 (`k'_47_full) ///
		,keep(mpu_2day) mcolor(white) mlcolor(black) coeflabels(mpu_2day = " ") ///
		 ciopts(recast(rcap) lcolor(black)) levels(90) legend(off) msymbol(circle)
		 
		graph export "tables\figureA7_`k'_eme.pdf", replace	
		
	
	clear matrix 

}

restore 
